import React from 'react';
import ReactDOM from 'react-dom';
import { HashRouter as Router } from 'react-router-dom';
import './css/index.css';
import * as serviceWorker from './serviceWorker';


import Home from './router/home/home.js'
import MyLink from './router/my_link/my_link.js'


let htmlDOM = document.getElementsByTagName('html')[0]
if (document.documentElement.clientWidth < 480) {
   htmlDOM.style.fontSize = document.documentElement.clientWidth / 20 + 'px'
} else {
   htmlDOM.style.fontSize = '24px'
}
window.onresize = function () {
   if (document.documentElement.clientWidth < 480) {
      htmlDOM.style.fontSize = document.documentElement.clientWidth / 20 + 'px'
   } else {
      htmlDOM.style.fontSize = '24px'
   }
}

// //判断是否是微信浏览器的函数
// function isWeiXin(){
//     //window.navigator.userAgent属性包含了浏览器类型、版本、操作系统类型、浏览器引擎类型等信息，这个属性可以用来判断浏览器类型
//     var ua = window.navigator.userAgent.toLowerCase();
//     //通过正则表达式匹配ua中是否含有MicroMessenger字符串
//     if(ua.match(/MicroMessenger/i) == 'micromessenger'){
        
//     }else{
//         window.location.href = 'http://www.jiaoguoliang.com'
//     }
// }
// isWeiXin()
ReactDOM.render(
   <Router>
      <div>
         {Home}
         {MyLink}
      </div>
   </Router>
   , document.getElementById('root'));
serviceWorker.unregister();
